// 按照交易药品查询
function findOne(hId) {
    var dd=hId;
    $.ajax({
        url: '/myspringboot/StatisticsController/findOneDiByHs',
        type: 'post',
        dataType: "json",
        data:{
            hId:dd,
        },
        success:function (result) {
            var list = result.data;
            $(".modal22").empty();
            for (var i = 0; i < list.length; i++) {
                //药品流水号
                var daNumber = list[i].diNumer;
                //通用名
                var diName = list[i].diName;
                //剂型
                var diForm = list[i].diForm;
                //规格
                var diSpecifications = list[i].diSpecifications;
                //单位
                var diUnit = list[i].diUnit;
                //装换系数
                var diCc = list[i].diCc;
                //生产企业
                var mf_name = null;
                var daName = null;
                var manufacturer = list[i].manufacturer;
                if (manufacturer != null) {
                    mf_name = manufacturer.mfName;
                }else {
                    mf_name="null"
                }
                var drugAtegory = list[i].drugAtegory;
                if (drugAtegory == null) {
                    daName = "null"
                } else {

                    //商品名称
                    daName = drugAtegory.daName;
                }
                //中间jia
                var diNewPrice = list[i].diNewPrice;

                //药品类别
                var drugCategory = list[i].drugCategory;
                if (drugCategory != null) {
                    var dcName = drugCategory.dcName;
                } else {
                    var dcName = "null"
                }
                //交易状态
                var diTradingStatus = list[i].diTradingStatus;
                var a = "";
                if (diTradingStatus == 0) {
                    a = "未交易";
                } else {
                    a = "交易完成"
                }
            var tr = '<table><tr>'+
                '<td>药品流水号</td>'+
                '<td><input name="drugNumber" id="drugNumber" class="ypbh" onblur=""value='+daNumber+' type=""></td>'+
                '</tr><tr>'+
                '<td>通用名</td>'+
                '<td><input name="diName" id="diName" class="ypbh" onblur=""value='+diName+' type=""></td>'+
                '</tr><tr>'+
                '<td>剂型</td>'+
                '<td><input name="diForm" id="diForm" class="ypbh" onblur=""value='+diForm+' type=""></td>'+
                '</tr><tr>'+
                '<td>规格</td>'+
                '<td><input name="diSpecifications" id="diSpecifications" class="ypbh" onblur=""value='+diSpecifications+' type=""></td>'+
                '</tr><tr>'+
                '<td>单位</td>'+
                '<td><input name="diUnit" id="diUnit" class="ypbh" onblur=""value='+diUnit+' type=""></td>'+
                '</tr><tr>'+
                '<td>转换系数</td>'+
                '<td><input name="diCc" id="diCc" class="ypbh" onblur=""value='+diCc+' type=""></td>'+
                '</tr><tr>'+
                '<td>生产企业</td>'+
                '<td><input name="dcName" id="dcName" class="ypbh" onblur=""value='+mf_name+' type=""></td>'+
                '</tr><tr>'+
                '<td>商品名称</td>'+
                '<td><input name="state" id="state" class="ypbh" onblur=""value='+daName+' type=""></td>'+
                '</tr><tr>'+
                '<td>中标价</td>'+
                '<td><input name="state" id="state" class="ypbh" onblur=""value='+diNewPrice+' type=""></td>'+
                '</tr><tr>'+
                '<td>药品类别</td>'+
                '<td><input name="state" id="state" class="ypbh" onblur=""value='+dcName+' type=""></td>'+
                '</tr><tr>'+
                '<td>交易状态</td>'+
                '<td><input name="state" id="state" class="ypbh" onblur=""value='+a+' type=""></td>'+
                '</tr></table>'
            $(".modal22").append(tr);
        }
        }
    })
}

function daochu() {
    $.ajax({
        url: '/myspringboot/StatisticsController/findAllExport1',
        type: 'post',
        dataType: "json",
        data: {
            surId:dd,
        },
    })
}